package com.yehun.dao.impl;

import com.yehun.dao.CategoryDao;
import com.yehun.entity.Category;
import com.yehun.mapper.CategoryMapper;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;
import java.util.List;

@Repository
public class CategoryDaoImpl implements CategoryDao {

    @Resource
    private CategoryMapper categoryMapper;

    @Override
    public List<Category> listAll() {
        return categoryMapper.listAll();
    }

    @Override
    public List<Category> listFirst() {
        return categoryMapper.listChilds(0);
    }

    @Override
    public List<Category> listNavShow() {
        return categoryMapper.listNavShow();
    }

    @Override
    public List<Category> listChilds(int id) {
        return categoryMapper.listChilds(id);
    }

    @Override
    public Category get(int id) {
        return categoryMapper.get(id);
    }

    @Override
    public int save(Category category) {
        return categoryMapper.save(category);
    }

    @Override
    public int update(Category category) {
        return categoryMapper.update(category);
    }

    @Override
    public int removeLogical(int[] idArray) {
        return categoryMapper.removeLogical(idArray);
    }

    @Override
    public int removePhysics(int[] idArray) {
        return categoryMapper.removePhysics(idArray);
    }
}
